<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #d1{
            display: none;
        }
        #t{
            width: 300px;
            height: 150px;
        }




    </style>
</head>
<body>
    <div  id="d1">
        <textarea  id="t">



        </textarea>
        <button  id="d3">保存</button>
  </div>
  <button   id="d2">发表</button>
  <div id="d4">



  </div>
  <script>
      d2.onclick=function(){
          d1.style.display="block";
          focus();
      }
      d3.onclick=function(){
    var  newdiv=      document.createElement("div");
        newdiv.innerHTML=t.value;
        d4.appendChild(newdiv);
        d1.style.display="none";
        t.value=" ";

 }




  </script>
    
</body>
</html>